package myproject.CarRentalSystem;

public class Saloon extends Car {
    private String kind;//型号

    public Saloon() {
    }

    public Saloon(String kind) {
        this.kind = kind;
    }

    public Saloon(String brand, int dayOfMoney, String plate, boolean state, String kind) {
        super(brand, dayOfMoney, plate, state);
        this.kind = kind;
    }

    public String getKind() {
        return kind;
    }

    public void setKind(String kind) {
        this.kind = kind;
    }

    @Override
    public String toString() {
        return "轿车  " +
                getBrand() +
                kind + "  " +
                getPlate() + "  " +
                getDayOfMoney() + "元  " +
                (getState() ? "已租用" : "可租用");
    }

    @Override
    public float rentMoney(int day) {
        if (day < 7) {
            return getDayOfMoney() * day * 1.0f;
        } else if (day < 30) {
            return getDayOfMoney() * day * 0.9f;
        } else if (day < 150) {
            return getDayOfMoney() * day * 0.8f;
        } else {
            return getDayOfMoney() * day * 0.7f;
        }

    }
}
